import request from '../request.js'

// 根据用户昵给成员称新增权限
export const getAllMenuAndFileApi = (data, ownerId) => {
  return request.get(`menu/list/all?id=${ data }&owner=${ ownerId }`)
}


export const addMenuApi = (data) => {
  return request.post('menu/add/child', data)
}

export const uploadFileApi = (data, onUploadProgress) => {
  return request.post('file/upload', data, {
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    onUploadProgress
  })
}

export const updateFileNameApi = (data) => {
  return request.post('file/update', data)
}

export const downloadFileApi = (data, onDownloadProgress) => {
  return request.post('file/download', data, {
    responseType: 'blob',
    onDownloadProgress
  })
}

export const deleteFileBatchApi = (data) => {
  return request.post('file/delete/batch', data)
}

export const deleteMenuApi = (data) => {
  return request.post('menu/delete', data)
}

export const updateMenuNameApi = (data) => {
  return request.post('menu/update', data)
}

export const transferFileBatchApi = (data) => {
  return request.post('file/transfer/batch', data)
}






